﻿namespace KingerRobot.MexicoSailunMDC.Spi;
/// <summary>
/// 位置服务
/// </summary>
public interface IPositionService
{
    /// <summary>
    /// 修改当前位置绑定任务
    /// </summary>
    /// <param name="locId">库位ID</param>
    /// <param name="taskNo">任务流水号</param>
    /// <returns></returns>
    int UpdateRcsLocationIsTaskNo(long locId, int taskNo);
    /// <summary>
    /// 通过条码修改绑定任务
    /// </summary>
    /// <param name="locId">库位ID</param>
    /// <param name="productCode">条码</param>
    /// <param name="isDeleteLoc">是否删除位置绑定</param>
    /// <returns></returns>
    int UpdateRcsLocationIsProductCode(long locId, string productCode, int taskNo, bool isDeleteLoc = false);

    /// <summary>
    /// 通过条码修改ems绑定任务
    /// </summary>
    /// <param name="locId">库位ID</param>
    /// <returns></returns>
    int UpdateEmsRcsLocationIsProductCode(long locId, int taskNo);

    /// <summary>
    /// 堆垛机前重新找入库口
    /// </summary>
    /// <param name="locId"></param>
    /// <param name="productCode"></param>
    /// <param name="lineTaskNo"></param>
    /// <returns></returns>
    long GetRcsLocationIsProductCode(long locId, string productCode, int lineTaskNo);

    /// <summary>
    /// 修改位置条码
    /// </summary>
    /// <param name="locId"></param>
    /// <param name="productCode"></param>
    /// <returns></returns>
    int UpdateRcsLocationBindProductCode(long locId, string productCode);
    /// <summary>
    /// 根据库位ID获得地址信息
    /// </summary>
    /// <param name="locId">库位ID</param>
    /// <returns></returns>
    PositionInfo GetLocationInfo(long locId);
    /// <summary>
    /// 获取起始位置
    /// </summary>
    /// <param name="bizTaskBean"></param>
    /// <returns></returns>
    PositionBean GetLocationBean(BizTaskBean bizTaskBean);

    /// <summary>
    /// 通过位置清空
    /// </summary>
    /// <param name="locId"></param>
    /// <returns></returns>
    int DeleteWcsLocSkuByLoc(long locId);

}
/// <summary>
/// 位置信息
/// </summary>
public class PositionInfo
{
    /// <summary>
    /// 任务ID
    /// </summary>
    public long? Id { get; set; }
    /// <summary>
    /// 库位编号
    /// </summary>
    public string Code { get; set; }
    /// <summary>
    /// X轴坐标
    /// </summary>
    public int? X { get; set; }
    /// <summary>
    /// Y轴坐标
    /// </summary>
    public int? Y { get; set; }
    /// <summary>
    /// Z轴坐标
    /// </summary>
    public int? Z { get; set; }
    /// <summary>
    /// T轴坐标
    /// </summary>
    public int? T { get; set; }
    /// <summary>
    /// 组号
    /// </summary>
    public long? GroupId { get; set; }
    /// <summary>
    /// 顺序号
    /// </summary>
    public long? GroupIndex { get; set; }
}

/// <summary>
/// 位置对象
/// </summary>
public class PositionBean
{
    public int TaskNo { get; set; }
    /// <summary>
    /// 任务ID
    /// </summary>
    public long? TakeId { get; set; }
    /// <summary>
    /// 库位编号
    /// </summary>
    public string TakeCode { get; set; }
    /// <summary>
    /// X轴坐标
    /// </summary>
    public int? TakeX { get; set; }
    /// <summary>
    /// Y轴坐标
    /// </summary>
    public int? TakeY { get; set; }
    /// <summary>
    /// Z轴坐标
    /// </summary>
    public int? TakeZ { get; set; }
    /// <summary>
    /// T轴坐标
    /// </summary>
    public int? TakeT { get; set; }
    /// <summary>
    /// X轴坐标
    /// </summary>
    public int? NTakeX { get; set; }
    /// <summary>
    /// Y轴坐标
    /// </summary>
    public int? NTakeY { get; set; }
    /// <summary>
    /// Z轴坐标
    /// </summary>
    public int? NTakeZ { get; set; }
    /// <summary>
    /// T轴坐标
    /// </summary>
    public int? NTakeT { get; set; }
    /// <summary>
    /// 组号
    /// </summary>
    public long? TakeGroupId { get; set; }
    /// <summary>
    /// 顺序号
    /// </summary>
    public long? TakeGroupIndex { get; set; }



    /// <summary>
    /// 任务ID
    /// </summary>
    public long? PutId { get; set; }
    /// <summary>
    /// 库位编号
    /// </summary>
    public string PutCode { get; set; }
    /// <summary>
    /// X轴坐标
    /// </summary>
    public int? PutX { get; set; }
    /// <summary>
    /// Y轴坐标
    /// </summary>
    public int? PutY { get; set; }
    /// <summary>
    /// Z轴坐标
    /// </summary>
    public int? PutZ { get; set; }
    /// <summary>
    /// T轴坐标
    /// </summary>
    public int? PutT { get; set; }
    /// <summary>
    /// X轴坐标
    /// </summary>
    public int? NPutX { get; set; }
    /// <summary>
    /// Y轴坐标
    /// </summary>
    public int? NPutY { get; set; }
    /// <summary>
    /// Z轴坐标
    /// </summary>
    public int? NPutZ { get; set; }
    /// <summary>
    /// T轴坐标
    /// </summary>
    public int? NPutT { get; set; }
    /// <summary>
    /// 组号
    /// </summary>
    public long? PutGroupId { get; set; }
    /// <summary>
    /// 顺序号
    /// </summary>
    public long? PutGroupIndex { get; set; }
}